package com.mlt.back.service.impl;

import com.mlt.back.beans.Brand;
import com.mlt.back.dao.BrandDao;
import com.mlt.back.dao.impl.BrandDaoImpl;
import com.mlt.back.service.BrandService;

import java.util.List;

public class BrandServiceImpl implements BrandService {
    private BrandDao brandDao=new BrandDaoImpl();
    @Override
    public List<Brand> selectAll() {
        List<Brand> brands=brandDao.selectAll();
        return brands;
    }

    @Override
    public List<Brand> selectByCategoryId(String category_id) {
        List<Brand> brands=brandDao.selectByCategoryId(category_id);
        return brands;
    }

    @Override
    public int delById(String brand_id) {
        int count=0;
        count=brandDao.delById(brand_id);
        return count;
    }


    @Override
    public void changeStatus(String brand_id,String status) {
        brandDao.changeStatus(brand_id,status);
    }

    @Override
    public Brand selectById(String brand_id) {
        Brand brand=brandDao.selectById(brand_id);
        return brand;
    }

    @Override
    public void doUpdate(Brand brand) {
        brandDao.doUpdate(brand);
    }
}
